/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.umum.common;

/**
 *
 * @author Administrator
 */
import java.util.ArrayList;
import java.util.Date;

import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.security.MessageDigest;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import org.apache.log4j.*;
import org.apache.log4j.xml.DOMConfigurator;

//=============================================================
public class BaseFunction {

    static Logger logger = Logger.getLogger(BaseFunction.class);

//=============================================================
    /**
     * 秒转分
     * @param s
     * @return
     */
    public static Integer SectoMin(String s) {
        try {
            Integer ss = Integer.parseInt(s);
            Integer m = Integer.parseInt(s) / 60;
            if (ss > m * 60) {
                return m + 1;
            } else {
                return m;
            }
        //return  Integer.valueOf(Integer.parseInt(s)/60);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static String SectoMinCn(String s) {
        try {
            Integer ss = Integer.parseInt(s);
            Integer m = Integer.parseInt(s) / 60;
            Integer sy = 0;
            String str = "";
            String min="\u5206";
            String sec="\u79D2";
            if (m == 0) {
                str = ss + sec;
            } else if (ss >= m * 60) {
                sy = ss - m * 60;
                str = m + min + sy + sec;
            } else {
                str = ss + min;
            }
            return str;
        //return  Integer.valueOf(Integer.parseInt(s)/60);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
